﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using ESpace.DalTools.SqlServer;
using ESpace.DalTools.SQLite;

namespace ESpace.DalTools.Contracts
{
	public interface IEntityBuilder
	{
		string DBServer { get; set; }
		string DBName { get; set; }
		string DBPassword { get; set; }
		string DBUid { get; set; }
		string ConnectionString { get; set; }
		string DataEntitySavePath { get; set; }
		string BusEntitySavePath { get; set; }
		string DataEntityNameSpace { get; set; }
		string HbmSavePath { get; set; }
		string TableName { get; set; }
		void ConnectToDB();
		void BuilderDataEntity();
		void BuilderHbmXml();
		void DisconnectFromDB();
		DataTable GetUserTables();
		

	}

	public  static class BuilderEntityFactory 
	{
		public static IEntityBuilder Creator(string dbType)
		{

			IEntityBuilder ienb;

			switch (dbType)
			{
				case "SqlServer":
					ienb = new EntityBuilder();
					break;
				case "Sqlite":
					ienb = new EntityBuilderSQLite();
					break;
				//case "MySql":
				//    break;
				//case "Access":
				//    break;
				default:
					ienb = new EntityBuilder();
					break;
			
			}
			return ienb;
			
		}
	}
}
